<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "kd_classname".
 *
 * @property integer $class_id
 * @property integer $yey_id
 * @property string $class_name
 * @property string $create_time
 * @property string $update_time
 * @property string $fengcun_time
 */
class Classname extends \yii\db\ActiveRecord
{
    public function behaviors(){
        return [
            [
                'class' => \app\components\behaviors\LogBehavior::className(),
                'tableName' => '班级',
                'attributeValue' => 'class_name',
            ],
            [
                'class'=>\app\components\behaviors\CreatorBehaviors::className(),
                'fieldName'=>'created_by',
            ],
            [
                'class'=>\app\components\behaviors\DatetimeBehavior::className(),
                'createDate'=>'create_time',
                'updateDate'=>'update_time'
            ],
            [
                'class'=>\app\components\behaviors\RecoverBehavior::className(),
            ],
        ];
    }
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'kd_classname';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['yey_id','status'], 'integer'],
            [['class_name'],  'required'],
            [['create_time', 'update_time', 'fengcun_time','created_by'], 'safe'],
            [['class_name','fengcun_ren','zb_teacher','fb_teacher','sh_teacher','stu_num'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'class_id' => '班级序号',
            'yey_id' => '所属幼儿园序号',
            'class_name' => '班级名称',

            'zb_teacher' => '主班老师',
            'fb_teacher' => '副班老师',
            'sh_teacher' => '生活老师',
            'stu_num' => '幼儿人数',


            'created_by' => '创建人',
            'create_time' => '添加时间',
            'update_time' => '最后修改时间',
            'fengcun_ren' => '封存人',
            'fengcun_time' => '班级封存时间',
            'status' => '状态',
        ];
    }
}
